const { Sequelize, sequelize } = require('./init')

const leave = sequelize.define('leave', {
    stu_id: {
        type: Sequelize.INTEGER,
    },
    reason: {
        type: Sequelize.STRING,
    },
    leavetype: {
        type: Sequelize.STRING,
    },
    starttime: {
        type: Sequelize.DATE,
    },
    endtime: {
        type: Sequelize.DATE,
    },
    state: {
        type: Sequelize.INTEGER,
    },
    createtime: {
        type: Sequelize.DATE,
    },
    classes: {
        type: Sequelize.STRING,
    }
}
);
/*const { Sequelize, DataTypes } = require('sequelize');
const sequelize = new Sequelize('sqlite::memory:');

const User = sequelize.define('User', {
  // 在这里定义模型属性
  firstName: {
    type: DataTypes.STRING,
    allowNull: false
  },
  lastName: {
    type: DataTypes.STRING
    // allowNull 默认为 true
  }
}, {
  // 这是其他模型参数
});

// `sequelize.define` 会返回模型*/
leave.sync().then(()=>{
    console.log('同步')
 })